// scaup - Scala up!
// (c) 2008-2010, Normen Müller, normen.mueller@gmail.com  
// $Id: OS.scala 78 2010-05-13 12:25:41Z normen.mueller $
package scaup.io

import scaup.Views._

/**
 *  @author <a href="mailto:normen.mueller@googlemail.com">Normen M&#xFC;ller</a>
 *  @version 0.0.4
 */
object OS {
  private val os = System.getProperty("os.name")
  
  lazy val isWindows = os != null && os.toLowerCase.indexOf("windows") >= 0
  
  lazy val isLinux = !isWindows && os != null && os.toLowerCase.indexOf("linux") >= 0
  
  lazy val isOSX = !isWindows && os != null  && (os.toLowerCase.indexOf("mac") >= 0 || os.toLowerCase.indexOf("darwin") >= 0)
  
  lazy val is32Bit = "32".equals(System.getProperty("sun.arch.data.model", "32"))
  
  lazy val is64Bit = "64".equals(System.getProperty("sun.arch.data.model", "64"))
  
  lazy val TMP = System.getProperty("java.io.tmpdir").toFile
  
  lazy val HOME = System.getProperty("user.home").toFile
}
